#include <cstdio>


int translate[256];


inline void init ()
{
	// Same as original.
	translate['\n'] = '\n';
	translate['-'] = '-';
	translate['0'] = '0';
	translate['1'] = '1';
	// True translation.
	translate['A'] = '2';
	translate['B'] = '2';
	translate['C'] = '2';
	translate['D'] = '3';
	translate['E'] = '3';
	translate['F'] = '3';
	translate['G'] = '4';
	translate['H'] = '4';
	translate['I'] = '4';
	translate['J'] = '5';
	translate['K'] = '5';
	translate['L'] = '5';
	translate['M'] = '6';
	translate['N'] = '6';
	translate['O'] = '6';
	translate['P'] = '7';
	translate['Q'] = '7';
	translate['R'] = '7';
	translate['S'] = '7';
	translate['T'] = '8';
	translate['U'] = '8';
	translate['V'] = '8';
	translate['W'] = '9';
	translate['X'] = '9';
	translate['Y'] = '9';
	translate['Z'] = '9';
}


int main ()
{
	int c;

	init ();

	while ((c = getchar ()) != EOF)
		putchar (translate[c]);

	return 0;
}